<?php

namespace app\store\controller\content;

use app\store\controller\Controller;
use app\store\model\Feedback as FeedbackModel;

/**
 * 文章管理控制器
 * Class article
 * @package app\store\controller\content
 */
class Feedback extends Controller
{
    /**
     * 文章列表
     * @return mixed
     * @throws \think\exception\DbException
     */
    public function index()
    {
        $model = new FeedbackModel;
        $list = $model->getList();
        return $this->fetch('index', compact('list'));
    }



    /**
     * 删除文章
     * @param $article_id
     * @return array
     * @throws \think\exception\DbException
     */
    public function delete($feedback_id)
    {
        // 文章详情
        $model = FeedbackModel::detail($feedback_id);
        if (!$model->setDelete()) {
            return $this->renderError($model->getError() ?: '删除失败');
        }
        return $this->renderSuccess('删除成功');
    }

}